|
![](/i/fill.gif) |
I used a technique pretty common in scanline-rendering for "faking" fast
reflections: Environment mapping.
In environment mapping a spherical view of the scene from the point of view
of the object is first created and then, when the object is rendered, its
surface color is blended with the environment map with an algorithm pretty
similar to raytracing (the environment map acts like a sky_sphere and "rays"
are reflected from the surface of the object to this sky sphere; of course
no real "rays" need to be shot, but just calculate the point where the
"reflected ray" would hit the sky sphere and take the proper color from the
environment map).
Environment mapping works well only if the other objects in the scene are
far enough from the object. If there are objects too close, they will be
distorted in unnatural ways in the "reflection" (as can be seen for example
in the reflected checkered floor in my image).
Also environment mapping in scanline rendering doesn't work well with
self-reflecting objects nor mutually reflecting objects (but it *does* work
in raytracing!).
(A variant of this is to use cube mapping, which is basically the same thing,
but the "sky sphere" is a cube instead. The advantage of this is that the
environment map is much easier to calculate by scanline rendering.)
What I did was to make a 2-frames animation: The first frame creates the
environment map using the spherical camera and focal blur (as many guessed).
(Of course focal blur doesn't work with the spherical camera in the current
POV-Ray, as I have reported in p.b-t, so I had to fix it before I could make
this image.) The camera was located in the center of the sphere and the
sphere just had a no_image specified to it (it had to be there for the
shadow).
The second frame of this "animation" loads the first frame and puts it
as a sky_sphere (I could do this because the sky is not seen directly in the
image). All the other objects now get the no_reflection tag so that the sphere
will reflect the sky_sphere instead.
And that's it.
(If you wonder if this environment map trick would work with other objects
than just a sphere, the answer is yes. As I said before, this is a pretty
common technique used in scanline-rendering to add "reflections" to any
object. It's just that all the other objects have to be far enough for it
to look good.)
And here is the first frame of the animation, ie. the environment map:
Post a reply to this message
Attachments:
Download 'envmap.png' (114 KB)
Preview of image 'envmap.png'
![envmap.png](/povray.binaries.images/attachment/%3C3bd0823b%40news.povray.org%3E/envmap.png?preview=1)
|
![](/i/fill.gif) |